{% extends "index.html" %}
{% load dajaxice_templatetags %}
{% load item_tags %}

{% block scripts %}
	{% dajaxice_js_import %}
	<script type="text/javascript" src="{{ STATIC_URL }}scripts/own/document_autocomplete.js"></script>
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			autoComplete = new DocumentAutoComplete($("#id_name"), '{{ document.module_part.id }}', '{{ document.module_term.id }}');
			$('.hint').tooltip({
				position: 'center right',
				effect: 'fade'
			});
		});
	</script>
{% endblock %}

{% block inline_navi %}
    <a href="{% url documents.views.index %}">
    	Dokumente
   	</a>
    &nbsp;>&nbsp;
    <a href="{% url documents.views.modulelist document.module_part.module.faculty.id %}">
    	{{ document.module_part.module.faculty }}
   	</a>
    &nbsp;>&nbsp;
    <a href="{% url documents.views.module document.module_term.id %}">
    	{{ document.module_part.module.name }} ({{ document.module_term.lecturer.last_name }} - {{ document.module_term.semester }})
    </a>
    &nbsp;>&nbsp;
    {{ document.module_part.name }}
    &nbsp;>&nbsp;
    {{ document }}
    &nbsp;>&nbsp;
    Verändern
{% endblock %}


{% block box_title %}
	Lerneinheit verändern
{% endblock %}
{% block box_content %}
	<p>
	    Hier kannst du die Lerneinheit "{{ document.name }}" verändern.
	    {% document_description %}
	</p>
	
	<div id="detail_table">
	    <h3>Lerneinheit</h3>
	    <form action="{% url documents.views.change_document document.id %}" enctype="multipart/form-data" method="post">
	        {% csrf_token %}
	        {{ form.non_field_errors }}
	        <table>
				{% document_fields form module_part module_term %}
	            <tr>
	                <td colspan="3" align="center" style="padding-top: 10px;">
	                    <input type="submit" value="Verändern" />
	                </td>
	            </tr>
	        </table>
	    </form>
	</div>
{% endblock %}